<template>
  <div class="top-header">
    <span class="iconfont">&#xe63f;</span>
    <p class="header-text">北京理工大学国防科技园2号楼10层</p>
    <span class="iconfont">&#xe8fc;</span>
  </div>
  <div class="search">
    <span class="iconfont">&#xe6c8;</span>
    <span class="placeholder">山姆会员商店优惠商品</span>
  </div>
  <div class="banner">
    <img :src="bannerImg" />
  </div>
  <div class="icons">
    <div class="icons__item" v-for="item in iconsList" :key="item.desc">
      <img class="icons__item__img" :src="`http://www.dell-lee.com/imgs/vue3/${item.imgName}.png`" />
      <p class="icons__item__desc">{{ item.desc }}</p>
    </div>
  </div>
  <div class="tag"></div>
</template>

<script setup>
import bannerImg from '../../assets/banner.jpg'
const iconsList = [
  { imgName: '超市', desc: '超市便利' },
  { imgName: '菜市场', desc: '菜市场' },
  { imgName: '水果店', desc: '水果店' },
  { imgName: '鲜花', desc: '鲜花绿植' },
  { imgName: '医药健康', desc: '医药健康' },
  { imgName: '家居', desc: '家居时尚' },
  { imgName: '蛋糕', desc: '烘培蛋糕' },
  { imgName: '签到', desc: '签到' },
  { imgName: '大牌免运', desc: '大牌免运' },
  { imgName: '红包', desc: '红包套餐' },
]
</script>

<style lang="scss" scoped>
.top-header {
  display: flex;
  align-items: center;
  margin: 0.1rem 0 0.16rem;
  .iconfont {
    font-size: 0.2rem;
  }
  .header-text {
    flex: 1;
    margin: 0;
    font-size: 0.16rem;
    padding: 0 0.06rem;
    @include ellipsis;
  }
}
.search {
  height: 0.32rem;
  background: #f5f5f5;
  border-radius: 0.16rem;
  display: flex;
  align-items: center;
  color: $search-fontColor;
  box-sizing: border-box;
  padding: 0 0.16rem;
  .placeholder {
    margin-left: 0.12rem;
    font-size: 0.14rem;
  }
}
.banner {
  margin: 0.12rem 0;
  height: 0;
  overflow: hidden;
  padding-bottom: 39.86%;
  img {
    display: block;
    width: 100%;
    border-radius: 0.08rem;
  }
}
.icons {
  display: flex;
  flex-wrap: wrap;
  text-align: center;
  &__item {
    width: 20%;
    margin-bottom: 0.1rem;
    img {
      display: block;
      width: 0.4rem;
      height: 0.4rem;
      margin: 0 auto;
    }
    &__desc {
      font-size: 0.12rem;
      margin: 0.06rem 0;
    }
  }
}
.tag {
  height: 0.1rem;
  background-color: $content-bgColor;
  margin: 0 -0.18rem;
}
</style>
